
import {Table}from 'antd'
import React from "react";
import axios from "axios";
axios.defaults.timeout= 16000;



class Cnckb extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      a: [],
      b: [],
      c: [],
      d: [],
      e: [],
      f: [],
      g: [],
      h: [],
      i: [],
      j: [],
      k1: [],
      a12:[],
      a13:[],
      a14:[],
      a15:[],
      a16:[],
      a17:[],
      a1:[],
      a18:[],
      a19:[],
      a20:[],
      a21:[],
      a31:[],
      a22:[],
      a23:[],
      a24:[],
      a25:[],
      a36:[],
      a37:[],
      a38:[],
      a39:[],
      a40:[],

    };
  }
  
  
  /* 
  a= 蔡正平= 43.153.65.89
  b= 郭发展=  43.153.79.98
  c = 郭蒋平= 43.135.172.133
  d  = 郭凯鸿6=43.152.217.89
  e=  郭煜尚7= 43.158.210.229
  f= 李瑶瑶2= 43.158.194.253
  g=  潘秀丽1= 43.134.231.239
  h=    彭香兰8=  43.135.155.149
  i= 叶凤华3=43.156.231.195
  j= 沈信义5=119.28.250.113
  k=刘爱绿4=119.28.250.113
  */
  componentDidMount() {
   // 账号1的高度a
 axios
      .get("http://43.153.65.89:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a: "0" });
      })
      //账号2高度b
    axios
      .get("http://43.153.8.136:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          b: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ b: "0" });
      });
         //账号3高度c
    axios
      .get("http://43.153.15.197:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          c: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ c: "0" });
      });
         //账号4高度d
    axios
      .get("http://129.226.30.131:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          d: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ d: "0" });
      });
         //账号5高度e
    axios
      .get("http://43.135.162.210:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          e: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ e: "0" });
      });
         //账号6高度f
    axios
      .get("http://43.153.49.20:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          f: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ f: "0" });
      });
         //账号7高度g
    axios
      .get("http://43.153.117.44:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          g: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ g: "0" });
      });
         //账号8高度h
    axios
      .get("http://43.153.55.221:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          h: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ h: "0" });
      });
         //账号9高度i
    axios
      .get("http://129.226.214.155:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          i: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ i: "0" });
      });
         //账号10高度j
    axios
      .get("http://43.159.47.159:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          j: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ j: "0" });
      });
        //账号11高度k
    axios
    .get("http://43.153.62.208:31401")
    .then((res) => {
      console.log(res.data.core_latest_ledger);
      this.setState({
        k1: res.data.core_latest_ledger,
      });
    })
    .catch((err) => {
      this.setState({ k1: "0" });
    });
     
     //账号12高度a12
     axios
     .get("http://43.134.166.106:31401")
     .then((res) => {
       console.log(res.data.core_latest_ledger);
       this.setState({
         a12: res.data.core_latest_ledger,
       });
     })
     .catch((err) => {
       this.setState({ a12: "0" });
     });
      //账号13高度a13
    axios
    .get("http://43.152.217.161:31401")
    .then((res) => {
      console.log(res.data.core_latest_ledger);
      this.setState({
        a13: res.data.core_latest_ledger,
      });
    })
    .catch((err) => {
      this.setState({ a13: "0" });
    });
     //账号13高度a14
     axios
     .get("http://43.153.92.177:31401")
     .then((res) => {
       console.log(res.data.core_latest_ledger);
       this.setState({
         a14: res.data.core_latest_ledger,
       });
     })
     .catch((err) => {
       this.setState({ a14: "0" });
     });
      //账号13高度a15
    axios
    .get("http://43.134.88.192:31401")
    .then((res) => {
      console.log(res.data.core_latest_ledger);
      this.setState({
        a15: res.data.core_latest_ledger,
      });
    })
    .catch((err) => {
      this.setState({ a15: "0" });
    });
     //账号13高度a16
     axios
     .get("http://43.135.158.203:31401")
     .then((res) => {
       console.log(res.data.core_latest_ledger);
       this.setState({
         a16: res.data.core_latest_ledger,
       });
     })
     .catch((err) => {
       this.setState({ a16: "0" });
     });
      //账号13高度a17
    axios
    .get("http://43.153.99.250:31401")
    .then((res) => {
      console.log(res.data.core_latest_ledger);
      this.setState({
        a17: res.data.core_latest_ledger,
      });
    })
    .catch((err) => {
      this.setState({ a17: "0" });
    });
     //账号13高度a18
     axios
     .get("http://43.134.237.87:31401")
     .then((res) => {
       console.log(res.data.core_latest_ledger);
       this.setState({
         a18: res.data.core_latest_ledger,
       });
     })
     .catch((err) => {
       this.setState({ a18: "0" });
     });
      //账号13高度a19
    axios
    .get("http://43.135.166.224:31401")
    .then((res) => {
      console.log(res.data.core_latest_ledger);
      this.setState({
        a19: res.data.core_latest_ledger,
      });
    })
    .catch((err) => {
      this.setState({ a19: "0" });
    });
     //账号13高度a20
     axios
     .get("http://129.226.28.114:31401")
     .then((res) => {
       console.log(res.data.core_latest_ledger);
       this.setState({
         a20: res.data.core_latest_ledger,
       });
     })
     .catch((err) => {
       this.setState({ a20: "0" });
     });
      //账号13高度a21
    axios
    .get("http://43.153.19.30:31401")
    .then((res) => {
      console.log(res.data.core_latest_ledger);
      this.setState({
        a21: res.data.core_latest_ledger,
      });
    })
    .catch((err) => {
      this.setState({ a21: "0" });
    });
     //账号13高度a22
     axios
     .get("http://43.153.66.45:31401")
     .then((res) => {
       console.log(res.data.core_latest_ledger);
       this.setState({
         a22: res.data.core_latest_ledger,
       });
     })
     .catch((err) => {
       this.setState({ a22: "0" });
     });
      //账号13高度a23
    axios
    .get("http://43.153.59.36:31401")
    .then((res) => {
      console.log(res.data.core_latest_ledger);
      this.setState({
        a23: res.data.core_latest_ledger,
      });
    })
    .catch((err) => {
      this.setState({ a23: "0" });
    });
    //  //账号13高度a25
    //  axios
    //  .get("http://43.152.217.161:31401")
    //  .then((res) => {
    //    console.log(res.data.core_latest_ledger);
    //    this.setState({
    //      a13: res.data.core_latest_ledger,
    //    });
    //  })
    //  .catch((err) => {
    //    this.setState({ a13: "0" });
    //  });

  }
  render() {
    const dataSource = [
      {
        key: '1',
        name:  '蔡元华',
       address: this.state.a,
       differ: this.state.a-this.state.a,
       todesk:'669 000 599',
       ip:<a href='http://43.153.65.89:31401' target="_blank">43.153.65.89</a>,       
        des: '云服务器美国',
      },
      {
        key: '2',
        name:  '陈彬',
       address: this.state.b,
       differ: this.state.a-this.state.b,
       todesk:'289 592 756',
       ip:<a href='http://43.153.8.136:31401' target="_blank">43.153.8.136</a>, 
        des: '云服务器美国',
      },
      {
        key: '3',
        name:  '陈克斌',
       address: this.state.c,
       differ: this.state.a-this.state.c,
       todesk:'125 986 328',
       ip:<a href='http://43.153.15.197:31401' target="_blank">43.153.15.197</a>, 
        des: '云服务器美国',
      },
      {
        key: '4',
        name:  '陈刘芳',
       address: this.state.d,
       differ: this.state.a-this.state.d,
       todesk:'315 385 501',
       ip:<a href='http://129.226.30.131:31401' target="_blank">129.226.30.131</a>, 
        des: <font color='red'>云服务器孟买</font>,
      },
      {
        key: '5',
        name:  '陈睿',
       address: this.state.e,
       differ: this.state.a-this.state.e,
       todesk:'792 183 339',
       ip:<a href='http://43.135.162.210:31401' target="_blank">43.135.162.210</a>, 
        des: '云服务器美国',
      },
       {
        key: '6',
        name:  '陈少林',
       address: this.state.f,
       differ: this.state.a-this.state.f,
       todesk:'325 786 479',
       ip:<a href='http://43.153.49.20:31401' target="_blank">43.153.49.20</a>, 
        des: '云服务器美国',
      },
      {
        key: '7',
        name:  '陈同帮',
       address: this.state.g,
       differ: this.state.a-this.state.g,
       todesk:'805 615 726',
       ip:<a href='http://43.153.117.44:31401' target="_blank">43.153.117.44</a>, 
        des: '云服务器美国',
      },
      {
        key: '8',
        name:  '陈杨微',
       address: this.state.h,
       differ: this.state.a-this.state.h,
       todesk:'900 706 762',
       ip:<a href='http://43.153.55.221:31401' target="_blank">43.153.55.221</a>, 
        des: '云服务器美国',
      },
      {
        key: '9',
        name:  '甘',
       address: this.state.i,
       differ: this.state.a-this.state.i,
       todesk:'136 746 514',
       ip:<a href='http://129.226.214.155:31401' target="_blank">129.226.214.155</a>, 
        des: '云服务器新加坡',
      },
      {
        key: '10',
        name:  '韩宏取',
       address: this.state.j,
       differ: this.state.a-this.state.j,
       todesk:'881 980 965',
       ip:<a href='http://43.159.47.159:31401' target="_blank">43.159.47.159</a>, 
        des: '云服务器新加坡',
      },
      {
        key: '11',
        name:  '黄通广',
       address: this.state.k1,
       differ: this.state.a-this.state.k1,
       todesk:'278 135 187',
       ip:<a href='http://43.153.62.208:31401' target="_blank">43.153.62.208</a>, 
        des: '云服务器美国',
      },
      {
        key: '12',
        name:  '胡忠海',
       address: this.state.a12,
       differ: this.state.a-this.state.a12,
       todesk:'776 281 764',
       ip:<a href='http://43.134.166.106:31401' target="_blank">43.134.166.106</a>, 
        des: '云服务器新加坡',
      },
      {
        key: '13',
        name:  '刘少珍',
       address: this.state.a13,
       differ: this.state.a-this.state.a13,
       todesk:'177 825 559',
       ip:<a href='http://43.152.217.161:31401' target="_blank">43.152.217.161</a>, 
        des: <font color='red'>云服务器孟买</font>,
      },
      {
        key: '14',
        name:  '李焱琼',
       address: this.state.a14,
       differ: this.state.a-this.state.a14,
       todesk:'851 328 472',
       ip:<a href='http://43.153.92.177:31401' target="_blank">43.153.92.177</a>, 
        des: '云服务器美国',
      },
      {
        key: '15',
        name:  '苏银满',
       address: this.state.a15,
       differ: this.state.a-this.state.a15,
       todesk:'399 475 163',
       ip:<a href='http://43.134.88.192:31401' target="_blank">43.134.88.192</a>, 
        des: '云服务器新加坡',
      },
      {
        key: '16',
        name:  '王秋山',
       address: this.state.a16,
       differ: this.state.a-this.state.a16,
       todesk:'534 512 840',
       ip:<a href='http://43.135.158.203:31401' target="_blank">43.135.158.203</a>, 
        des: '云服务器美国',
      },
      {
        key: '17',
        name:  '薛胜凯',
       address: this.state.a17,
       differ: this.state.a-this.state.a17,
       todesk:'121 093 037',
       ip:<a href='http://43.153.99.250:31401' target="_blank">43.153.99.250</a>, 
        des: '云服务器美国',
      },
      {
        key: '18',
        name:  '薛小英',
       address: this.state.a18,
       differ: this.state.a-this.state.a18,
       todesk:'260 684 163',
       ip:<a href='http://43.134.237.87:31401' target="_blank">43.134.237.87</a>, 
        des: '云服务器新加坡',
      },
      {
        key: '19',
        name:  '杨林香',
       address: this.state.a19,
       differ: this.state.a-this.state.a19,
       todesk:'811 906 459',
       ip:<a href='http://43.135.166.224:31401' target="_blank">43.135.166.224</a>, 
        des: '云服务器美国',
      },
      {
        key: '20',
        name:  '余兴容',
       address: this.state.a20,
       differ: this.state.a-this.state.a20,
       todesk:'127 824 715',
       ip:<a href='http://129.226.28.114:31401' target="_blank">129.226.28.114</a>, 
        des: <font color='red'>云服务器孟买</font>,
      },
      {
        key: '21',
        name:  '郑志龙',
       address: this.state.a21,
       differ: this.state.a-this.state.a21,
       todesk:'898 926 071',
       ip:<a href='http://43.153.19.30:31401' target="_blank">43.153.19.30</a>, 
        des: '云服务器美国',
      },
      {
        key: '22',
        name:  '陈定怒',
       address: this.state.a22,
       differ: this.state.a-this.state.a22,
       todesk:'672 612 123',
       ip:<a href='http://43.153.66.45:31401' target="_blank">43.153.66.45</a>, 
        des: '云服务器美国',
      },
      {
        key: '23',
        name:  '林贤园',
       address: this.state.a23,
       differ: this.state.a-this.state.a23,
       todesk:'425 126 439',
       ip:<a href='http://43.153.59.36:31401' target="_blank">43.153.59.36</a>, 
        des: '云服务器美国',
      },
      // {
      //   key: '1',
      //   name:  '蔡元华',
      //  address: this.state.a,
      //  differ: this.state.a-this.state.a,
      //   des: '云服务器美国',
      // },
      // {
      //   key: '1',
      //   name:  '蔡元华',
      //  address: this.state.a,
      //  differ: this.state.a-this.state.a,
      //   des: '云服务器美国',
      // },
    ];
    
    const columns = [
      {
        title: '业主名字',
        dataIndex: 'name',
        key: 'name',
      },
      {
        title: '区块高度',
        dataIndex: 'address',
        key: 'address',
      },
      {
        title: '区块延迟数值',
        dataIndex: 'differ',
        key: 'differ',
      },
      {
        title: "todesk",
        dataIndex: "todesk",
        key: "todesk",
      },
      {
        title: '云服务器ip地址',
        dataIndex: 'ip',
        key: 'ip',
      },
      {
        title: '云服务器地区',
        dataIndex: 'des',
        key: 'des',
      },
    ];
    return (
      <div>
            
        <center>
       
          <font size='18' color = "red" >苍南陈克斌23台节点区块高度</font> 
        <Table dataSource={dataSource} columns={columns} />;
  
        </center>
      </div>
    );
  }
}

export default Cnckb;

